﻿<!DOCTYPE html>
<html lang="en">
    <head>
        
        <script src="../../../../../Scripts/jquery-1.9.1.js"></script>
        <script src="../../../../../Scripts/jquery.form.js"></script>
        <script type="text/javascript" src="../../tiny_mce_popup.js"></script>

          <script type="text/javascript" src="js/dialog.js"></script>
    </head>
    <body>

        
        <form method="post" id="UpLoadForm" enctype="multipart/form-data" action="/FineUploader/UploadFile?picSize=0">
            <input type="file" id="flUpload"/> 
            <input type="button" id="btnUpload" onclick="GoUpload()" value="upload"/>
        </form>
    </body>
</html>

<script>
    function GoUpload() {
        if ($("#flUpload").val() == "") {
           alert("请选择一个图片文件，再点击上传。");
            return;
           }
        $('#UpLoadForm').ajaxSubmit({
           success: function (html, status) {
                 var result = html.replace("<pre>", "");
                result = result.replace("</pre>", "");
                 $("#image").attr('src', result);
               //alert(result);
               //alert(jbImagesDialog);
               //tinymce.EditorManager.activeEditor.insertContent('<img src="' + result.OriginalPicUrl+ '">');

                 //tinyMCEPopup.editor.execCommand('mceInsertContent', false, '<img src="' + result.OriginalPicUrl + '" />');
                 //tinyMCEPopup.close();
                 //jbImagesDialog.insert(result.OriginalPicUrl);
                 jbImagesDialog.uploadFinish(result.OriginalPicUrl);
           }
         });
    }
  
</script>


